package com.dragon.repository.domain.dto;

import com.dragon.repository.entity.TechnicalPerson;
import lombok.Data;
import io.swagger.annotations.ApiModelProperty;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.dragon.common.util.BeanUtils;

import java.util.ArrayList;
import java.util.List;


/**
 * @author sy
 */
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
public class TechnicalPersonDTO {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "id")
    private Integer id;

    @ApiModelProperty(value = "技术联系人名称")
    private String technicalName;

    @ApiModelProperty(value = "技术联系人手机号")
    private String technicalPhone;

    @ApiModelProperty(value = "技术联系人职位")
    private String technicalPosts;

    @ApiModelProperty(value = "技术联系人微信")
    private String technicalVx;


    public TechnicalPersonDTO() {}

    public TechnicalPersonDTO(TechnicalPerson entity) {
        BeanUtils.copyProperties(entity,this);
    }

    public static TechnicalPersonDTO convert(TechnicalPerson entity) {
        return new TechnicalPersonDTO(entity);
    }

    public static List<TechnicalPersonDTO> convertList(List<TechnicalPerson> list) {
        List<TechnicalPersonDTO> resultList = new ArrayList<>();
        for (TechnicalPerson entity : list) {
            resultList.add(new TechnicalPersonDTO(entity));
        }
        return resultList;
    }}
